<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
*/

/**
 * Description of MultiFile
 *
 * @author chaporgin_a
 */
class VA_Form_ViewHelper_Email_File extends VA_Form_ViewHelper {
    public function wrap() {
        $return = array();
        $return[] = $this->wrapFile($this->getElement()->getValue());
        return join(',',$return);
    }
    protected function wrapFile(VA_Form_File_TemporaryFile $file) {
        return sprintf('<a href="http://%s%s">%s</a>'
                , $_SERVER['HTTP_HOST']
                ,  substr($file->getPointer(), strlen(JPATH_BASE))
                , $file->getFilename()
        );
    }
}
?>
